package apiday02;

public class SplitDemo12 {
    public static void main(String[] args) {
        /*
         *测试Split:劈开
         */
/*        String str = "  1 , Tom, 110, tom@tedu.cn  ";
        String[] arr = str.split(",");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i].trim());//用trim（）减去两边的空格符
        }*/

        String str = "1  Tom   110   tom@tedu.cn  ";
        String[] arr = str.split("\\s+");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);//用trim（）减去两边的空格符
        }
    }
}
